package com.eduService.Controller;

import com.eduService.Service.ossService;
import com.eduService.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/eduService")
@CrossOrigin
public class ossController {
    @Autowired
    ossService ossService;

    @PostMapping("/ossfile")
    public R uploadFile(@RequestBody  MultipartFile file){
        System.out.println(1);
        System.out.println(file.getOriginalFilename()+"1");
        String url = ossService.uploadFile(file);
        return R.ok().data("url",url);
    }


}
